package com.yzc.android.common;

import android.app.Activity;

import com.marshalchen.ultimaterecyclerview.UltimateRecyclerView;
import com.yzc.android.BuildConfig;
import com.yzc.android.R;
import com.yzc.android.ui.RecyclerViewActivity;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

/**
 * Created by yzc on 16/5/4.
 */
@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class)
public class RecyclerViewActivityTestWithRobolectric {

    @Test
    public void testThatDefaultBehaviorIsWorking() throws Exception {
        Activity activity = Robolectric.setupActivity(RecyclerViewActivity.class);
        UltimateRecyclerView recyclerView = (UltimateRecyclerView) activity.findViewById(R.id.recycler_view);
        recyclerView.performClick();
        // http://robolectric.org/writing-a-test/
    }
}